package com.server.llh.llhserverwork.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;


import com.llh.llhsuppliers.R;
import com.server.llh.llhserverwork.activity.server.LlhOptionSubOrderActivity;
import com.server.llh.llhserverwork.adapter.base.ViewHolderBase;
import com.server.llh.llhserverwork.bean.Constants;
import com.server.llh.llhserverwork.port.HolderOnclickInterface;
import com.server.llh.llhserverwork.utils.ServerStatementData;
import com.squareup.picasso.Picasso;

/**
 * Created by ZTF on 2017-05-22.
 */

public class OptionSerOrderHolder extends ViewHolderBase<ServerStatementData.SerOrderInfoDetailBeanListBean> {
    ImageView imageDevice;
    TextView describeTxt;
    TextView priceTxt;
    TextView deviceType;
    TextView deviceNum;
    TextView deviceName;
    TextView depositTxt;
    private Context mContext;
    public OptionSerOrderHolder(LlhOptionSubOrderActivity context) {
        this.mContext = context;
    }

    @Override
    public View createView(LayoutInflater layoutInflater) {
        View v = LayoutInflater.from(mContext).inflate(R.layout.llh_order_item, null);
        imageDevice= (ImageView) v.findViewById(R.id.imageDevice);
        describeTxt= (TextView) v.findViewById(R.id.describeTxt);
        priceTxt= (TextView) v.findViewById(R.id.priceTxt);
        deviceType= (TextView) v.findViewById(R.id.device_type);
        deviceNum= (TextView) v.findViewById(R.id.device_num);
        deviceName= (TextView) v.findViewById(R.id.device_name);
        depositTxt= (TextView) v.findViewById(R.id.depositTxt);
        return v;
    }

    @Override
    public void showData(int position, ServerStatementData.SerOrderInfoDetailBeanListBean itemData) {
        Picasso.with(mContext).load(Constants.SER_IMAGE_URL+itemData.getSerOrderInfoDetail().getPictureUrl()).into(imageDevice);
        describeTxt.setText(""+itemData.getSerOrderInfoDetail().getPackageName());
        priceTxt.setText("");
//        deviceType.setText("订单号："+itemData.getSerOrderInfoDetail().getOrderCode());
        deviceType.setText("");
        deviceNum.setText("");
        deviceName.setText("价格："+itemData.getSerOrderInfoDetail().getPrice()+"/元");
        depositTxt.setText("共"+itemData.getSerOrderInfoDetail().getSerNum()+"个");
    }

    @Override
    public void showData(int position, ServerStatementData.SerOrderInfoDetailBeanListBean itemData, HolderOnclickInterface holderOnclickInterface) {

    }

}
